import axios from '@/utils/axios.js'
var pre = 'platform/admin/v1/outside/'
var func = [ 'getList', 'getData', 'add', 'apiUseStats', 'update', 'destroy', 'getApi' ]
var api = {}
func.forEach(value => {
  api[value] = pre + value
})

var getList = (params) => {
  return axios.get(api.getList, {params: params})
}

var getData = (params) => {
  return axios.get(api.getData, {params: params})
}

var add = (params) => {
  return axios.post(api.add, params)
}

var apiUseStats = (params) => {
  return axios.post(api.apiUseStats, params)
}

var getApi = (params) => {
  return axios.get(api.getApi, {params: params})
}

var update = (params) => {
  return axios.put(api.update, params)
}

var destroy = (params) => {
  return axios.delete(api.destroy, {data: params})
}

export { getList, getData, add, apiUseStats, update, getApi, destroy }
